﻿using SIG.InputModel.Admin.Articles;
using SIG.Model.Articles;
using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace SIG.InputModel.DTO
{
    public class ArticlePageMetaDTO
    {
        public int Id { get; set; }
        [Display(Name = "主题", Prompt = "主题")]
        [Required(ErrorMessage = "请输入主题")]
        public string Title { get; set; }

        [Display(Name = "内容", Prompt = "内容")]
        [Required(ErrorMessage = "请输入内容")]
        [AllowHtml]
        public string Body { get; set; }

        [Display(Name = "概要", Prompt = "概要")]
        public string Summary { get; set; }

        [Display(Name = "查看")]
        public int ViewCount { get; set; }
        [Display(Name = "新闻分类", Prompt = "新闻分类")]
        public int CategoryId { get; set; }

        [Display(Name = "缩略图", Prompt = "缩略图")]
        public string Thumbnail { get; set; }

        [Display(Name = "显示", Prompt = "显示")]
        public bool Active { get; set; }
        [Display(Name = "推荐", Prompt = "推荐")]
        public bool Recommend { get; set; }

        public virtual ArticleCategoryIM Category { get; set; }

        public string CategoryTitle
        {
            get
            {
                if (this.Category != null)
                {
                    return this.Category.Title;
                }
                return string.Empty;
            }
        }


        [Display(Name = "关键字", Prompt = "关键字")]
        public string Keywords { get; set; }

        [Display(Name = "SEO描述", Prompt = "SEO描述")]
        public string SEODescription { get; set; }

        [Display(Name = "创建日期")]
        [ScaffoldColumn(false)]
        public DateTime CreatedDate { get; set; }

        [Display(Name = "创建者")]
        [MaxLength(256)]
        [ScaffoldColumn(false)]
        public string CreatedBy { get; set; }

        [Display(Name = "最后修改时间")]
        [ScaffoldColumn(false)]
        public DateTime UpdatedDate { get; set; }
        [Display(Name = "最后修改者")]
        [MaxLength(256)]
        [ScaffoldColumn(false)]
        public string UpdatedBy { get; set; }
    }
}
